package sn.gandal.mobile.kalpet.android.response;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: SOWDIOMYERO
 * Date: 11 nov. 2012
 * Time: 18:06:08
 * Version : ${VERSION}
 * To change this template use File | Settings | File Templates.
 */
@XmlRootElement(name = "accountResponse")
public class AccountResponse {
    @XmlElement
    private String nom;
    @XmlElement
    private String prenom;
    @XmlElement
    private String sexe;
    @XmlElement
    private String adresse;
    @XmlElement
    private String tel;
    @XmlElement
    private String cni;
    @XmlElement
    private boolean enabled;    
    @XmlElement
    private String type;
    @XmlElement
    private Date dateCreated;
   // @XmlElement
    //CompteResponse compte;
       // private CompteResponse compteCredit;


    public AccountResponse(String nom, String prenom, String sexe, String adresse, String tel, String cni, boolean enabled, String type, Date dateCreated) {
        this.nom = nom;
        this.prenom = prenom;
        this.sexe = sexe;
        this.adresse = adresse;
        this.tel = tel;
        this.cni = cni;
        this.enabled = enabled;
        this.type = type;
        this.dateCreated = dateCreated;
    }

    public AccountResponse() {
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getSexe() {
        return sexe;
    }

    public void setSexe(String sexe) {
        this.sexe = sexe;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getCni() {
        return cni;
    }

    public void setCni(String cni) {
        this.cni = cni;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AccountResponse)) return false;

        AccountResponse that = (AccountResponse) o;

        if (cni != null ? !cni.equals(that.cni) : that.cni != null) return false;


        return true;
    }

    @Override
    public int hashCode() {
        int result = nom != null ? nom.hashCode() : 0;
        result = 31 * result + (prenom != null ? prenom.hashCode() : 0);
        result = 31 * result + (sexe != null ? sexe.hashCode() : 0);
        result = 31 * result + (adresse != null ? adresse.hashCode() : 0);
        result = 31 * result + (tel != null ? tel.hashCode() : 0);
        result = 31 * result + (cni != null ? cni.hashCode() : 0);
        result = 31 * result + (enabled ? 1 : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (dateCreated != null ? dateCreated.hashCode() : 0);
        return result;
    }
}
